﻿//Copyright 2011 - Jonathan Allen

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Granite.Collections
{
	///// <summary>
	///// This is essentially a by-directional Enumerator
	///// </summary>
	///// <typeparam name="T"></typeparam>
	//public class Cursor<T> : IEnumerator<T>
	//{
	//	readonly IList<T> m_List;
 //       int m_Index;


	//	/// <summary>
	//	/// 
	//	/// </summary>
	//	/// <param name="list"></param>
 //       public Cursor(IList<T> list)
	//	{
	//		if (list == null)
	//			throw new ArgumentNullException("list", "list is null.");

	//		m_List = list;
	//		m_Index = -1;
	//	}

	//	/// <summary>
	//	/// Gets the element in the collection at the current position of the enumerator.
	//	/// </summary>
	//	/// <returns>
	//	/// The element in the collection at the current position of the enumerator.
	//	/// </returns>
 //       public T Current
	//	{
	//		get {
	//			if (m_Index < 0)
	//				throw new InvalidOperationException("Cursor is before the start of the list.");
	//			if(m_Index >= m_List.Count)
	//				throw new InvalidOperationException("Cursor is past the end of the list.");
	//			return m_List[m_Index];
	//		}
	//	}

	//	/// <summary>
	//	/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
	//	/// </summary>
	//	/// <filterpriority>2</filterpriority>
 //       public void Dispose()
	//	{
	//		Dispose(true);
	//		GC.SuppressFinalize(this);
	//	}

	//	/// <summary>
	//	/// 
	//	/// </summary>
	//	/// <param name="disposing"></param>
 //       protected virtual void Dispose(bool disposing)
	//	{
	//		
	//	}

	//	/// <summary>
	//	/// Gets the element in the collection at the current position of the enumerator.
	//	/// </summary>
	//	/// <returns>
	//	/// The element in the collection at the current position of the enumerator.
	//	/// </returns>
 //       object System.Collections.IEnumerator.Current
	//	{
	//		get { return Current; }
	//	}

	//	/// <summary>
	//	/// 
	//	/// </summary>
	//	/// <returns>This is a no-op if already past the start of the collection.</returns>
 //       public bool MovePrevious()
	//	{
	//		if (m_Index == -1)
	//			return false;

	//		m_Index -= 1;

	//		return m_Index >= 0;
	//	}

	//	/// <summary>
	//	/// Advances the enumerator to the next element of the collection.
	//	/// </summary>
	//	/// <returns>
	//	/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
	//	/// </returns>
	//	/// <exception cref="T:System.InvalidOperationException">
	//	/// The collection was modified after the enumerator was created. 
	//	/// </exception>
	//	/// <filterpriority>2</filterpriority>
 //       public bool MoveNext()
	//	{
	//		if (m_Index == m_List.Count)
	//			return false;

	//		m_Index += 1;

	//		return m_Index < m_List.Count;
	//	}

	//	/// <summary>
	//	/// Sets the enumerator to its initial position, which is before the first element in the collection.
	//	/// </summary>
	//	/// <exception cref="T:System.InvalidOperationException">
	//	/// The collection was modified after the enumerator was created. 
	//	/// </exception>
	//	/// <filterpriority>2</filterpriority>
 //       public void Reset()
	//	{
	//		m_Index = -1;
	//	}
	//}
}

